﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MyWeb.Common;
using MyWeb.Data;
using MyWeb.Business;


namespace MyWeb.Admins
{
    public partial class Login1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogon_Click(object sender, EventArgs e)
        {
            int result = tb_AdminService.tb_Admin_GetByTop("", " Username='" + txtUsername.Text + "' And Password='" + txtPassword.Text + "'", "").Rows.Count;
            if (result>0)
            {
                Session["Admin"] = txtUsername.Text.Trim();
                Response.Redirect("~/Admin/Defaul.aspx");
            }else
                WebMsgBox.Show("Sai tên đăng nhập hoặc mật khẩu!");
            
        }

        protected void btnHuyBo_Click(object sender, EventArgs e)
        {

        }
    }
}